package com.dongan.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @ClassName GetSysDateTime
 * @Description
 * @Author liao
 * @Date2021/6/17 16:49
 * @Version V1.0
 **/
public class GetSysDateTime {
    public static Date getDatetime(){
        //获得系统时间.
        Date date = new Date();
        SimpleDateFormat sdf =   new SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " );
        String nowTime = sdf.format(date);
        Date time=null;
        try {
            time = sdf.parse(nowTime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return time;
    }
}
